package org.osite.xml.converter;

import org.osite.xml.AttributeConverter;
import org.osite.xml.ParseContext;
import org.osite.xml.XmlParseException;

public class DoubleConverter implements AttributeConverter<Double> {

	public Double convert(Class<?> type, String value, ParseContext context)
			throws XmlParseException {
		try {
			return Double.parseDouble(value);
		} catch (NumberFormatException e) {
			throw new XmlParseException("invalid double: " + value, e);
		}
	}
}
